package ttsolver.util;

public class InstantesUtil {
	// Constante que define a discretizacao de periodos do modelo (em segundos).
	public static final int discInstantes = 1 * 60;
	// Constante que define o horizonte de planejamento (em segundos).
	public static final int planningHorizon = 9000;

	
	
	public static int getInstanteMax() {
		return planningHorizon / discInstantes;
	}
	
	public static int getMaxSecond() {
		return planningHorizon;
	}

	public static int horaToInstante(double h) {
		double secs = h * 3600;
		double inst = secs / discInstantes;
		if ((int) inst < inst)
			return (int) (inst + 1);
		else
			return (int) inst;
	}
	
	public static int minToInstante(double m) {
		double secs = m * 60;
		double inst = secs / discInstantes;
		if ((int) inst < inst)
			return (int) (inst + 1);
		else
			return (int) inst;
	}
	
	public static int minToInstante(int m) {
		double secs = m * 60;
		double inst = secs / discInstantes;
		if ((int) inst < inst)
			return (int) (inst + 1);
		else
			return (int) inst;
	}
	
	public static double getDiscHour(){
		return (double) discInstantes / 3600;
	}

}
